﻿using CSC;
using System;
using System.Threading.Tasks;

namespace JDGLSys.Service
{
    public class EmailService
    {
        //开启一个线程，防止程序一直等待造成卡死
        public static Task NewThreadRun_Sendmail()
        {
            return Task.Run(() =>   //把与UI刷新无关的语句放到这个匿名委托中执行
            {
                String getmail, title, message;
                //LM----------2814017506@qq.com
                //YXL---------1843074461@qq.com
                //My----------qbmo@qq.com
                getmail = "2814017506@qq.com";
                title = "Test";
                message = "你好";
                for (int i = 0; i < 20; i++)
                {
                    message = "你正在被测试者轰炸，这是第" + i + "封------";
                    EmailHelper.Sendmail(getmail, title, message);
                }
            });
        }
    }
}
